home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / mpfeel.lha / MPFeel / Plurals / mp_debug.m < prev    next >
Text File  |  1992-07-15  |  1KB  |  78 lines

  1. /*
  2.  *    Debugging
  3.  *
  4.  *    Author:    S.C.Merrall
  5.  *
  6.  *    File:    debug.h
  7.  *
  8.  *    Contents:    init_debug - initialise debugging
  9.  *                      DBG_CALL   - register function entry
  10.  *                      DBG_ARGS   - list argument values
  11.  *                      DBG_EXIT   - register function exit
  12.  *
  13.  *    Description:    This supplies a concise trace system which can be
  14.  *                      witched on and off in files by including debug_off.h
  15.  *                      instead of debug.h
  16.  *
  17.  *    Change History:
  18.  *
  19.  *    Date   Name Comment
  20.  *    -------- ---- -------
  21.  *    06:02:91 SCM  Created
  22.  *    19:02:91 SCM  Added p_dbg_print - plural printer for debugging
  23.  *    22:04:91 SCM  Added dbg_g_activem for printing plurals in debug
  24.  *
  25.  */
  26.  
  27. #include <mpl.h>
  28. #include <stdio.h>
  29. #include "proc_pair.h"
  30. #include "mp_debug.h"
  31. #include "constant.h"
  32.  
  33. #ifdef dbg
  34.  
  35. #undef dbg
  36.  
  37. #endif
  38.  
  39. FILE *dbg;
  40.  
  41. visible int debug_status=FALSE;
  42. char *dbg_g_fname;
  43. plural short dbg_g_active;
  44. char *spaces =  "                    ";
  45.  
  46. #ifdef __STDC__
  47.  
  48. int init_debug( void )
  49.  
  50. #else
  51.  
  52. int init_debug( )
  53.  
  54. #endif
  55.  
  56. {
  57.   char *old_dbg_fname = "init_plural?";
  58.   char *dbg_fname = "init_debug";
  59.  
  60.   dbg_g_fname = dbg_fname;
  61.  
  62.   dbg = fopen(DBG_FNAME, "w");
  63.  
  64.   if (dbg == NULL) {
  65.  
  66. DBG_FAIL(fprintf(stderr,"FAIL: Unable to open debug file %s\n",DBG_FNAME));
  67.     dbg = stderr;
  68.     return FAIL;
  69.   }
  70.  
  71. DBG_EXIT(fprintf(dbg,"SUCCESS"));
  72.   return SUCCESS;
  73.  
  74. }
  75.  
  76.  
  77.  
  78.